// pages/all/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    ShowName:'AllOrders',
    unusedCouponsList:[],
    usedCouponList:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
    let unusedCouponsList = []
    let coupons = wx.getStorageSync('coupons')||[]
    coupons.forEach(v=>{
      if(v.state === "unused"){
        unusedCouponsList.unshift(v)
      }else{
        unusedCouponsList.push(v)
      }
    })
    this.setData({
      ShowName:options.name,
      unusedCouponsList,
    })
  },
  ChangShow(e){
    this.setData({
      ShowName:e.currentTarget.dataset.name
    })
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

})